Skip to content

Add changes for new menuinst fix#5

Merged
lrandersson merged 5 commits into
dev-ra-briefcase-integrationfrom
dev-ra-829
Jun 11, 2026
Merged

Add changes for new menuinst fix#5
lrandersson merged 5 commits into
dev-ra-briefcase-integrationfrom
dev-ra-829

Conversation

@lrandersson

@lrandersson lrandersson commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Description

This PR covers conda#1234.

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@lrandersson lrandersson self-assigned this Jun 10, 2026

rem Persist distribution_name to menuinst.toml before installing packages.
rem This ensures the value is captured even if no packages have shortcuts.
rem Must run before conda install to avoid creating shortcuts twice.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain that to me? I'm not sure I'm following.

What happens if a user selects to not install shortcuts and there are packages with shortcuts in the payload?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we didn't explicitly call menuinst --install before conda install:

  1. conda install runs
  2. No packages have Menu json files → conda never calls menuinst
  3. menuinst.toml is never created
  4. Because of 3) the value of MENUINST_DISTRIBUTION_NAME is never captured

Then as you can probably see, later (assuming above happened), when a user installs a package with shortcuts into this environment:

  1. conda calls menuinst to create shortcuts
  2. MENUINST_DISTRIBUTION_NAME is no longer set (installer finished long ago)
  3. menuinst.toml doesn't exist (was never created)
  4. menuinst falls back to deriving distribution_name from the prefix name → "base"

The explicit menuinst --install call ensures distribution_name is written to menuinst.toml now, while the env var is still set, regardless of whether any packages have shortcuts. This way the value is available for any future shortcut creation.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That part I understand, but not Must run before conda install to avoid creating shortcuts twice. Where would we create shortcuts twice?

@lrandersson lrandersson Jun 11, 2026

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, yeah I see that it's misleading. The comment was based upon a change I made earlier that didn't work which resulted in duplicated calls to menuinst. Removed, see 5a279c5

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, what happens if there are packages with shortcuts in the environment? Won't this run menuinst twice? What happens if a user selects not to install shortcuts and the environment has packages with shortcuts?

@lrandersson lrandersson Jun 11, 2026

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So since this is called before any packages are installed, all it does is creating menuinst.toml, and this will happen regardless or not if the user chooses to (or not to) install shortcuts via the installer.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how I understand the menuinst workflow: If you don't give menuinst a list of packages, it will install all shortcuts in the prefix. So, if there is a prefix with packages that install shortcuts, this command will install them before installing the conda package. More importantly, it will install shortcuts even if the user selected not to install shortcuts because there is no guard.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the sequence right now:

  1. Payload tarball is extracted into %INSTDIR%
  2. Packages are extracted into %BASE_PATH%\pkgs\<name> (importantl that they're not considered installed yet
  3. menuinst --install runs, and right now %BASE_PATH%\Menu\ is empty and no .json files exist
  4. conda install runs which will populate (if packages with shortcuts are installed) the %BASE_PATH%\Menu directory

But at step 3 above, the important detail is that there are no .json files in the Menu directory, which results in only menuinst.toml being generated containing the value of distribution_name.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, great. Can you point that out in the comment? This isn't an immediately obvious detail.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 6b6306d

@lrandersson lrandersson merged commit a99c71b into dev-ra-briefcase-integration Jun 11, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants